FROM ubuntu:18.04

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai
ENV QT_QPA_PLATFORM=offscreen
RUN mkdir -p /tmp/wkhtml_runtime && chmod 777 /tmp/wkhtml_runtime
ENV XDG_RUNTIME_DIR=/tmp/wkhtml_runtime

# 合并安装指令并清理缓存
RUN apt-get update && \
    apt-get install -y wkhtmltopdf xvfb openssl libssl-dev ttf-wqy-microhei fonts-thai-tlwg msttcorefonts && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

COPY pdfservice /

CMD [ "/pdfservice" ]
EXPOSE 8080
